﻿<local:ChoBaseWindowEx x:Class="ChoWorkflowDashboard.AddOrEditHolidayCalWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Holiday Calendar Manager" Height="590" Width="948"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        xmlns:local="clr-namespace:ChoWorkflowDashboard"
        xmlns:cal="clr-namespace:ChoWorkflowDashboard;assembly=ChoWorkflowDashboard" Loaded="Window_Loaded" ResizeMode="NoResize" 
        ShowInTaskbar="False" Topmost="False"
        BorderBrush="{DynamicResource AccentColorBrush}"
        BorderThickness="1"
        ShowMaxRestoreButton="false" ShowMinButton="false"
                       >
    <Grid x:Name="MasterGrid" >
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="42" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" Margin="0,0,10,0" >
            <Button Content="Import" Height="23" HorizontalAlignment="Left" Margin="10,10,0,0" Name="btnImport" VerticalAlignment="Top" Width="75" TabIndex="9" Tag="4" Click="btnImport_Click" />
            <Button Content="OK" Height="23" HorizontalAlignment="Left" Margin="10,10,0,0" Name="btnOK" VerticalAlignment="Top" Width="75" TabIndex="10" Click="btnOK_Click" IsDefault="True" Tag="4" />
            <Button Content="Cancel" Height="23" HorizontalAlignment="Left" Margin="10,10,0,0" Name="btnCancel" VerticalAlignment="Top" Width="75" TabIndex="11" Click="btnCancel_Click" IsCancel="True" Tag="5" />
        </StackPanel>
        <Grid Grid.Row="0" Grid.ColumnSpan="2" >
            <Grid.RowDefinitions>
                <RowDefinition Height="100" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200"/>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <GroupBox Grid.Row="0" Grid.Column="0" Header="Add New Holiday Calendar" Name="groupBox3" Width="190" BorderThickness="0.5">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="75" />
                    </Grid.ColumnDefinitions>
                    <xctk:WatermarkTextBox Grid.Row="0" Grid.ColumnSpan="2" Watermark="Enter holiday cal name" Height="23" Name="txtHolidayCalName" MaxLength="50" CharacterCasing="Upper" TabIndex="1" 
                                                local:Masking.Mask="^[A-Za-z0-9_]*$" ToolTip="Accepts only [A-Z0-9] characters" />
                    <Button Content="Add New" Grid.Row="1" Grid.Column="1" Height="23" Name="btnNewHolidayCal" TabIndex="3" Click="btnNewHolidayCal_Click" />
                </Grid>
            </GroupBox>
            <GroupBox Grid.Row="0" Grid.RowSpan="2" Grid.Column="1" Header="Calendar" Name="grpHolidayCalendar" BorderThickness="0.5">
                <Grid>
                    <local:MonthViewControl x:Name="AptCalendar" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" AppointmentDblClicked="AptCalendar_AppointmentDblClicked" DayBoxDoubleClicked="AptCalendar_DayBoxDoubleClicked" DisplayMonthChanged="AptCalendar_DisplayMonthChanged" ToolTip="{Binding Path=AptDateAuditInfo}" />
                </Grid>
            </GroupBox>

            <GroupBox Grid.Column="0" Grid.Row="1" Header="All Holiday Calandars" Name="groupBox4" Width="190" BorderThickness="0.5">
                <Grid >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="75"/>
                        <RowDefinition Height="25"/>
                    </Grid.RowDefinitions>
                    <ListBox Grid.Row="0" Name="lstHolidayCals" ItemsSource="{Binding Path=HolidayCalendarTable}" 
                             IsSynchronizedWithCurrentItem="True" TabIndex="4" SelectionChanged="lstHolidayCals_SelectionChanged" 
                             MouseDoubleClick="lstHolidayCals_MouseDoubleClick" ToolTip="Double click to edit holiday calendar comments" 
                             >
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding CAL_NAME}" />
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <xctk:WatermarkTextBox Grid.Row="1" AcceptsReturn="True" AcceptsTab="True" Height="72" MaxLength="50" Name="txtHolidayCalDesc" TabIndex="5" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" Watermark="Enter comments" 
                                            Text="{Binding ElementName=lstHolidayCals, Path=SelectedItem.Row.CAL_DESC}" >
                        <xctk:WatermarkTextBox.ToolTip>
                            <ToolTip Content="{Binding Path=AuditInfo}" Background="Aqua" Foreground="Black" />
                        </xctk:WatermarkTextBox.ToolTip>
                    </xctk:WatermarkTextBox>
                    <StackPanel Grid.Row="2" Orientation="Horizontal" >
                        <Button Content="Delete" Height="23" Name="btnDeleteHolidayCal" Width="49" TabIndex="8" Click="btnDeleteHolidayCal_Click" />
                        <Button Content="Clone" Height="23" Name="btnClone" TabIndex="7" Width="49" Click="btnClone_Click" />
                        <Button Content="Export" Height="23" Name="btnExport" TabIndex="6" Width="49" Click="btnExport_Click" />
                    </StackPanel>
                </Grid>
            </GroupBox>
        </Grid>
    </Grid>
</local:ChoBaseWindowEx>
